import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'base_controller.dart';

abstract class BaseView<T extends BaseController> extends GetView<T> {
  const BaseView({Key? key}) : super(key: key);

  Widget buildView(BuildContext context);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: appBar(context),
      body: SafeArea(
        child: Obx(() {
          return Stack(
            children: [
              buildView(context),
              if (controller.isLoading)
                const Center(
                  child: CircularProgressIndicator(),
                ),
            ],
          );
        }),
      ),
      bottomNavigationBar: bottomNavigationBar(context),
      floatingActionButton: floatingActionButton(context),
      drawer: drawer(context),
      endDrawer: endDrawer(context),
    );
  }

  PreferredSizeWidget? appBar(BuildContext context) => null;
  Widget? bottomNavigationBar(BuildContext context) => null;
  Widget? floatingActionButton(BuildContext context) => null;
  Widget? drawer(BuildContext context) => null;
  Widget? endDrawer(BuildContext context) => null;
} 